package hafnium.bukkit.util;

public class Optimizer implements Runnable {
	private Optimizable[] opts;
	
	public Optimizer() {
		opts = new Optimizable[0];
	}
	
	public void register(Optimizable opt) {
		Optimizable[] nopts = new Optimizable[opts.length + 1];
		
		for (int i = 0; i < opts.length; i++) {
			nopts[i] = opts[i];
		}
		
		nopts[opts.length] = opt;
		
		opts = nopts;
	}

	@Override
	public void run() {
		// TODO: Thread-safe all instances of Optimizable.
		// TODO: Implement this.
	}
}
